const setButton = document.getElementById('btn')
const titleInput = document.getElementById('title')
setButton.addEventListener('click', () => {
    const title = titleInput.value
    window.electronAPI.setTitle(title)
});

const btnUnlockCheckCode = document.getElementById('btnUnlockCheckCode')

btnUnlockCheckCode.addEventListener('click', () => {
    window.electronAPI.unlockCheckcode({"left":484.5,"top":427.5})
});

btnSubmitCookie.addEventListener('click', () => {
    window.electronAPI.submitCookie({"left":484.5,"top":427.5})
});

document.onkeydown=function(e){    //对整个页面监听  
    var keyNum=window.event ? e.keyCode :e.which;       //获取被按下的键值  
    //判断如果用户按下了回车键（keycody=13）  
    if(keyNum==13){  
        //alert('您按下了回车');  
    }  
     
    //判断如果用户按下了空格键(keycode=32)，  
    if(keyNum==32){  
        //alert('您按下了空格');  
    }  
     
    //判断如果用户按下了Shift键(keycode=32)和回车键（keycody=13）  
    if (13 == e.keyCode && e.shiftKey){
        //alert('您按下了Shift和回车');  
        window.electronAPI.unlockCheckcode({"left":484.5,"top":427.5}) 
    }
}    